package org.duang.render;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public abstract class Render implements Serializable {
	
	private static final long serialVersionUID = -8406693915721288408L;
	
	protected transient HttpServletRequest request;
	protected transient HttpServletResponse response;
	protected Object obj;
	protected String view;
	
	public final Render setContext(HttpServletRequest request, HttpServletResponse response) {
		this.request = request;
		this.response = response;
		return this;
	}
	
	public final Render setContext(HttpServletRequest request, HttpServletResponse response, String view) {
		this.request = request;
		this.response = response;
		this.view = view;
		return this;
	}
	
	public String getView() {
		return view;
	}
	
	public void setView(String view) {
		this.view = view;
	}
	
	
	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public abstract void render();
}
